// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分，具体配置参考文档
const path = require('path')

function resolve(dir) {
    return path.join(__dirname, dir)
}

const name = '狼眼电影后台管理' // 标题

module.exports = {
    devServer: {
        port: 8888,
        //开发环境下设置为编译好以后直接打开浏览器浏览
        //open: true,
        // 开发环境下设置禁用域名访问检查（可支持web浏览器域名访问）
        disableHostCheck: true
    },
    /*configureWebpack : {
        name,
        //调试JS
        // 开启源码映射
        devtool: "source-map",
        //devtool: 'eval-cheap-module-source-map'//生产环境使用
        resolve: {
            //配置路径别名
            alias: {
                '@': resolve('src'),
                'assets': resolve('src/assets'),
                '@assets': resolve('./src/assets'),
                'common': resolve('src/common'),
                '@common': resolve('./src/common'),
                'components': resolve('src/components'),
                '@components': resolve('./src/components'),
                'plugins': resolve('src/plugins'),
                '@plugins': resolve('./src/plugins'),
                'network': resolve('src/network'),
                '@network': resolve('./src/network'),
                'config': resolve('src/config'),
                '@config': resolve('./src/config'),
                'views': resolve('src/views'),
                '@views': resolve('./src/views'),
            }
        }
    },*/
    configureWebpack : (config) => {
        config.name = name,
        //调试JS
        // 开启源码映射
        config.devtool = "source-map";
        //devtool: 'eval-cheap-module-source-map'//生产环境使用
        //配置路径别名
        config.resolve.alias['@'] = resolve('src')
        config.resolve.alias['@'] = resolve('src'),
        config.resolve.alias['assets'] = resolve('src/assets'),
        config.resolve.alias['@assets'] = resolve('./src/assets'),
        config.resolve.alias['common'] = resolve('src/common'),
        config.resolve.alias['@common'] = resolve('./src/common'),
        config.resolve.alias['components'] = resolve('src/components'),
        config.resolve.alias['@components'] = resolve('./src/components'),
        config.resolve.alias['plugins'] = resolve('src/plugins'),
        config.resolve.alias['@plugins'] = resolve('./src/plugins'),
        config.resolve.alias['network'] = resolve('src/network'),
        config.resolve.alias['@network'] = resolve('./src/network'),
        config.resolve.alias['config'] = resolve('src/config'),
        config.resolve.alias['@config'] = resolve('./src/config'),
        config.resolve.alias['views'] = resolve('src/views'),
        config.resolve.alias['@views'] = resolve('./src/views');
    },
    css: {
        //查看CSS属于哪个css文件
        //sourceMap: true,
    },
    // 不同发布环境的根路径区分
    publicPath:process.env.NODE_ENV === 'production'?'/film-manage-ui':'/'
}



